package org.microframework.cloud.auth.config.properties;

import java.util.ArrayList;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import lombok.Data;

/**
 * 安全白名单配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.security.ignore")
public class SecurityIgnoreProperties {
    
    /**
     * 静态资源
     */
    private List<String> static_ = new ArrayList<>();
    
    /**
     * 登录相关
     */
    private List<String> auth = new ArrayList<>();
    
    /**
     * Swagger文档
     */
    private List<String> swagger = new ArrayList<>();
    
    /**
     * Knife4j增强功能
     */
    private List<String> knife4j = new ArrayList<>();
    
    /**
     * 监控端点
     */
    private List<String> actuator = new ArrayList<>();
    
    /**
     * 获取所有白名单
     */
    public List<String> getAllIgnoreUrls() {
        List<String> urls = new ArrayList<>();
        urls.addAll(static_);
        urls.addAll(auth);
        urls.addAll(swagger);
        urls.addAll(knife4j);
        urls.addAll(actuator);
        return urls;
    }
} 